Merged
Conversation
catilac
requested changes
Mar 23, 2026
Contributor
catilac
left a comment
There was a problem hiding this comment.
looks good! i have a question and would love the macro you wrote to have a little bit of documentation please!
Comment on lines
+7
to
+11
| if val == 0.0 { | ||
| 0.0f32.to_bits().hash(state); | ||
| } else { | ||
| val.to_bits().hash(state); | ||
| } |
Contributor
There was a problem hiding this comment.
oo very curious about this
Member
Author
There was a problem hiding this comment.
This handles positive and negative zero in IEEE floats by treating them the same. Hashing a Vec4 is probably a bit sketchy (and glam does not impl Hash on the Rust side) but is very convenient for quick-and-dirty (AKA art).
Contributor
There was a problem hiding this comment.
AH the pos and neg IEEE float. thank you!
Comment on lines
+89
to
+97
| macro_rules! impl_py_vec { | ||
| ( | ||
| $name:ident, $py_name:literal, $n:literal, | ||
| [$(($field:ident, $set_field:ident, $idx:literal)),+], | ||
| $glam_ty:ty | ||
| $(, extra { $($extra:tt)* })? | ||
| ) => { | ||
| #[pyclass(name = $py_name, from_py_object)] | ||
| #[derive(Clone, Debug)] |
Contributor
There was a problem hiding this comment.
can we add some documentation here? i'm still a macro_rules! bb
catilac
approved these changes
Mar 23, 2026
This was referenced Mar 23, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wraps
glamin Python, allowing users to call most processing methods as either:foo(1.0, 3.0, 4.0)orfoo(vec2(1.0, 3.0, 4.0)).Allowing both is helpful -- users can use the vec types to do linalg stuff and avoid having to pass things as
v.x, v.y, v.z, etc.Converts most internal
processing_renderAPIs to useglamrather than explicitf32args. We should have done this from the start and avoids unnecessary conversions.We don't currently have matrices here, but they can be added later.